<template>
	<view class="container">
		<view class="list" v-for="(item,index) in applyList" :key="index">
			<view class="per_process" @click.stop="redirection(item)">
				<view class="top">
					<text :style="{background:$classify(item.status,1)}">{{$classify(item.status,3)}}</text>
					<text>{{item.meeting_room_detail?item.meeting_room_detail.name:''}}</text>
					<text>{{$format(item.start_time,1)}}</text>
					<text>{{$format(item.start_time,2)}}-{{$format(item.end_time,2)}}</text>
				</view>
				<view class="center">
					<image src="../../../static/tupian114.png" mode="widthFix"></image>
					<text>{{item.teacher_user_info?item.teacher_user_info.full_name:''}}</text>
				</view>
				<view class="bottom">
					<image src="../../../static/tupian104.png" mode="widthFix"></image>
					<text>{{item.remark}}</text>
				</view>
			</view>
		</view>
	</view>
	</view>
</template>

<script>
	import request from '../../../request.js'
	export default {
		data() {
			return {
				apply_list: [],
			}
		},
		computed: {
			applyList() {
				if (this.apply_list) {
					return this.apply_list;
				} else {
					return [];
				}
			},

		},
		methods: {
			applyLists() {
				let base_url = uni.getStorageSync('host');
				console.log(base_url);
				let _this = this;
				request({
					url: base_url + 'teacher/meeting_room/applyLists',
					method: 'post',
					data: {
						status: 0,
					},
					success(res) {
						if (res.statusCode == 200) {
							console.log(res.data.data.data);
							_this.apply_list = res.data.data.data;
						} else {
							_this.$refs.uToast.show({
								title: res.data.message || '系统错误',
								type: 'warning',
							})
						}

					}
				})
			},
			redirection(param) {
				this.$toLink('../handle_application/handle_application', {
					name: param.meeting_room_detail.name,
					apply_id: param.apply_id,
					address: param.meeting_room_detail.place,
					type: param.meeting_room_detail.type,
					note: param.remark,
					start_date: param.start_time,
					end_date: param.end_time,
					event: param.event,
					people: param.meeting_room_detail.people
				});
			}
		}
	}
</script>

<style lang="scss">
	.list {
		width: 100%;
		height: 195rpx;
		overflow: hidden;

		.per_process {
			margin-top: 22rpx;
			margin-left: 20rpx;
			height: 169rpx;
			width: 710rpx;
			border-radius: 15rpx;
			box-shadow: 0px 1px 1px 1px #ccc;

			.top {
				width: 100%;
				height: 60rpx;
				display: flex;
				justify-content: flex-start;

				text {
					margin-top: 20rpx;

					&:nth-child(1) {
						background-color: #FFA100;
						background: rgb(67, 218, 194);
						width: 60rpx;
						margin-left: 20rpx;
						height: 30rpx;
						margin-top: 25rpx;
						border-radius: 8rpx;
						color: #fff;
						font-size: 16rpx !important;
						text-align: center;
						line-height: 30rpx;
					}

					&:nth-child(2) {
						color: #333333;
						margin-left: 20rpx;
						font-size: 28rpx;
						width: 330rpx;
					}

					&:nth-child(3) {
						color: #999999;
						font-size: 20rpx;
						margin-top: 25rpx;

					}

					&:nth-child(4) {
						margin-left: 20rpx;
						color: #999999;
						font-size: 20rpx;
						margin-top: 25rpx;
					}
				}

				.active {
					background: #FFA100 !important;
				}
			}

			.center {
				width: 100%;
				height: 45rpx;
				display: flex;
				justify-content: flex-start;

				image {
					&:nth-child(1) {
						margin-top: 15rpx;
						margin-left: 20rpx;
						width: 30rpx;
					}
				}

				text {
					&:nth-child(2) {
						margin-top: 15rpx;
						margin-left: 30rpx;
						font-size: 24rpx;
						color: #666666;
					}
				}
			}

			.bottom {
				width: 100%;
				height: 45rpx;
				display: flex;
				justify-content: flex-start;

				image {
					&:nth-child(1) {
						margin-top: 15rpx;
						margin-left: 20rpx;
						width: 30rpx;
					}
				}

				text {
					&:nth-child(2) {
						margin-top: 15rpx;
						margin-left: 30rpx;
						font-size: 24rpx;
						color: #666666;
					}
				}
			}
		}
	}
</style>
